//
//  LJUtility.h
//  Onskysell
//
//  Created by LJJ on 17/7/10.
//  Copyright © 2017年 cg. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef void (^FingerVerifyBlock)(NSString *error);

@interface LJUtility : NSObject

/**
 *  计算contentView的高度
 */
+(float)cellHeightOfContentView:(UIView *)contentView;

/**
 *  添加蒙版
 */
+(void)addMaskViewOnWindow;

/**
 *  消除蒙版
 */
+(void)dismissMaskViewFromWindow;

/**
 *  获取蒙版
 */
+ (UIView *)getMaskViewOnWindow;

/**
 *  字典转json
 */
+ (NSString *)dictionaryToJson:(NSDictionary *)dic;

/**
 *  数组转json
 */
+ (NSString *)arrayToJson:(NSArray *)arr;

/**
 *  json转字典
 */
+ (NSDictionary *)dictionaryWithJsonString:(NSString *)jsonString;

/**
 *  url编码
 */
+ (NSString *)urlEncodedString:(NSString *)str;

/**
 *  url解码
 */
+ (NSString *)urlDecodedString:(NSString *)str;

/**
 *  判断是否是iphonex
 */
+ (BOOL)isIphoneX;

/**
 *  获得设备型号
 */
+ (NSString *)getiPhoneType;


/**
 *  获得状态栏view
 */
+ (UIView *)getStatusBar;

/**
 *  获取时间字符串
 */
+ (NSString *)getDateTimeString;

/**
 *  获取随机串
 */
+ (NSString *)randomStringWithLength:(int)len;

/**
 *  删除指定位置文件
 */
+ (BOOL)deleteFileWithPath:(NSString *)path;

/**
 *  七牛云上传文件
 */
+ (void)uploadFileToQNFilePath:(NSString *)filePath fileName:(NSString *)fileName;

/**
 *  crash报告收集处理(上传到七牛云网盘)
 */
+ (void)crashCollectAndReport;

/**
 *  获取截取到的图片(计算量小 速度快)
 *
 *  @return UIImage *
 */
+ (UIImage *)getScreenshotImg;

+ (CGFloat)getStatusBarHeight;
+ (BOOL)theStringIsValid:(NSString *)string;

//判断url or string包含string(忽略大小写)
+ (BOOL)theString:(NSString *)url containSting:(NSString *)string;

//判断url or string包含string(区分大小写)
+ (BOOL)theString:(NSString *)str absoluteContainSting:(NSString *)string;

+ (void)sendEmailTo:(NSString *)toEmail info:(NSString *)info;

//获取时间戳字符串
+ (NSString *)getTimeStampString;

//指纹识别 ---------------------------
//设备是否支持指纹识别 - 返回值为错误信息, 无返回值则说明支持
+ (NSString *)getSupportFingerprintIdentifyResult;
//指纹验证 - 处理结果 和 是否带右边按钮
+ (void)toVerifyFingerprintWithResult:(FingerVerifyBlock)resultBlock isWithRightBtn:(BOOL)haveRightBtn;

/**
 *  md5摘要算法
 */
+ (NSString*)md5:(NSString*)str;

+ (NSString *)getBaseHost;

+ (void)clearWKWebMemoryDiskCache;

+ (UIImage *)imageWithColor:(UIColor *)color size:(CGSize)size;

@end
